﻿@model Model.IFConfig
@{
    ViewBag.Title = "编辑接口配置";
    Layout = "~/Views/Shared/_Main.cshtml";
}
<script type="text/javascript">
    function Save() {
        if (IsNullOrEmpty($("#txt_IFSysName").val())) {
            alert("接口系统名称不能为空！");
            return false;
        }
        if (IsNullOrEmpty($("#txt_IFName").val())) {
            alert("接口名称不能为空！");
            return false;
        }
        if (IsNullOrEmpty($("#txt_IColumnName").val())) {
            alert("收件人不能为空！");
            return false;
        }
        if (IsNullOrEmpty($("#txt_MinInterval").val())) {
            $("#txt_MinInterval").val("0");
        }
        $.post("/SysUser/SaveIFItem", { query: jv.GetDivJson($(".searchArea"), 4) }, function (res) {
            if (res == 1) {
                alert("操作成功！");
            } else
                alert(res);
            returnParent();
        });
    }
    function checkLength(v) {
        if (v.length > 450)
            return v.substr(0, 450);
        else
            return v;
    }
    function back() {
        goto("/SysUser/IFList");
    }
</script>
<div style="margin: 5px;">
    <table class="listTitle">
        <tr>
            <td width="15">
                <img src="/images/edit.png" />
            </td>
            <td width="300">
                编辑接口配置
            </td>
            <td align="right">
                <input id="btnSearch" type="button" class="button" value=" 保存 " onclick="Save()" />
            </td>
        </tr>
    </table>
    <table class="searchArea" width="100%">
        <tr>
            <td width="100" align="right">
                接口系统名称:
            </td>
            <td>@Model.IFSysName
                <input type="hidden" id="hid_GUID" value="@Model.GUID" />
                <input id="txt_IFSysName" type="hidden" value="@Model.IFSysName" />
            </td>
        </tr>
        <tr>
            <td width="100" align="right">
                接口名称:
            </td>
            <td>@Model.IFName
                <input id="txt_IFName" type="hidden" value="@Model.IFName" />
            </td>
        </tr>
        <tr>
            <td align="right">
                收件人:
            </td>
            <td>@Model.IColumnName
                <input id="txt_IColumnName" type="hidden" value="@Model.IColumnName" />
            </td>
        </tr>
        <tr>
            <td align="right">
                最小发送间隔:
            </td>
            <td>
                <input id="txt_MinInterval" maxlength="8" style="width: 80px;" type="text" value="@Model.MinInterval"  onkeyup="this.value=checkNum(this.value)" />
                秒
            </td>
        </tr>
        <tr>
            <td align="right" valign="top">
                消息内容:
            </td>
            <td>
                <textarea id="txt_MsgContent" onkeyup="this.value=checkLength(this.value)" rows="5"
                    style="width: 380px;">@Model.MsgContent</textarea>
            </td>
        </tr>
    </table>
</div>
